package util;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class ExtensionFilter extends FileFilter {

	private static final String[] acceptedExtensions = new String[] { "bmp",
			"tiff", "jpg" };

	/*
	 * Acepta las extensiones validas de archivos
	 */

	@Override
	public boolean accept(File file) {
		for (String extension : acceptedExtensions) {
			if (file.getName().toLowerCase().endsWith(extension)) {
				return true;
			}
		}
		return false;
	}

	@Override
	public String getDescription() {
		return "Archivos de imagen  (" + acceptedExtensions[0] + ","
				+ acceptedExtensions[1] + "," + acceptedExtensions[2] + ")";
	}
}
